package mr.ali.video.web.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import mr.ali.video.web.model.CollectionTags;
import mr.ali.video.web.mapper.CollectionTagsMapper;
import mr.ali.video.web.service.ICollectionTagsService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author Mr-ali
 * @since 2025-08-03
 */
@Service
public class CollectionTagsServiceImpl extends ServiceImpl<CollectionTagsMapper, CollectionTags> implements ICollectionTagsService {
@Resource
    private CollectionTagsMapper collectionTagsMapper;
    @Override
    public Integer insert(CollectionTags collectionTags) {
        return collectionTagsMapper.insert(collectionTags);
    }

    @Override
    public Integer deleteByVideoId(Integer videoId) {
        QueryWrapper<CollectionTags> queryWrapper = new QueryWrapper<>();
        queryWrapper.eq("video_id",videoId);
        return collectionTagsMapper.delete(queryWrapper);
    }
}
